<?php

namespace common\model;

use think\model\RelationModel;

class RoleFilterModel extends RelationModel
{

    //自动验证
    protected $_validate = [
        ['role_id', '', '', self::MUST_VALIDATE, 'require', self::MODEL_INSERT],//必须字段
        ['role_id', '', '', self::EXISTS_VALIDATE, 'integer'],
        ['filter_id', '', '', self::MUST_VALIDATE, 'require', self::MODEL_INSERT],//必须字段
        ['filter_id', '', '', self::EXISTS_VALIDATE, 'integer'],
        ['role_id,filter_id', '', 'Role filter already exists.', self::MUST_VALIDATE, 'unique', self::MODEL_BOTH]
    ];
}
